home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / ctype.h.z / ctype.h
C/C++ Source or Header  |  1992-04-03  |  3KB  |  94 lines

  1. #ifndef __CTYPE_H__
  2. #define __CTYPE_H__
  3.  
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7.  
  8. /**************************************************************************
  9.  *                                      *
  10.  *          Copyright (C) 1984,1989 Silicon Graphics, Inc.          *
  11.  *                                      *
  12.  *  These coded instructions, statements, and computer programs  contain  *
  13.  *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
  14.  *  are protected by Federal copyright law.  They  may  not be disclosed  *
  15.  *  to  third  parties  or copied or duplicated in any form, in whole or  *
  16.  *  in part, without the prior written consent of Silicon Graphics, Inc.  *
  17.  **************************************************************************/
  18. /*    Copyright (c) 1984 AT&T    */
  19. /*      All Rights Reserved      */
  20.  
  21. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  22. /*    The copyright notice above does not evidence any       */
  23. /*    actual or intended publication of such source code.    */
  24.  
  25. /* #ident "$Revision: 1.15 $" */
  26.  
  27. /* ANSI C Notes:
  28.  *
  29.  * - THE IDENTIFIERS APPEARING OUTSIDE OF #ifdef __EXTENSIONS__ IN THIS
  30.  *   standard header ARE SPECIFIED BY ANSI!  CONFORMANCE WILL BE ALTERED
  31.  *   IF ANY NEW IDENTIFIERS ARE ADDED TO THIS AREA UNLESS THEY ARE IN ANSI's
  32.  *   RESERVED NAMESPACE. (i.e., unless they are prefixed by __[a-z] or
  33.  *   _[A-Z].  For external objects, identifiers with the prefix _[a-z] 
  34.  *   are also reserved.)
  35.  *
  36.  * - In addition, function names which begin with 'to[a-z]' or 'is[a-z]'
  37.  *   are reserved when including ctype.h (Section 4.13.2).
  38.  *
  39.  * - A prototype for each function required in <ctype.h> must be declared
  40.  *   prior to the macro definition, so that an #undef will expose it.
  41.  *
  42.  */
  43.  
  44. #define    _U    01    /* Upper case */
  45. #define    _L    02    /* Lower case */
  46. #define    _N    04    /* Numeral (digit) */
  47. #define    _S    010    /* Spacing character */
  48. #define    _P    020    /* Punctuation */
  49. #define    _C    040    /* Control character */
  50. #define    _B    0100    /* Blank */
  51. #define    _X    0200    /* heXadecimal digit */
  52.  
  53. extern int     isalnum(int);
  54. extern int     isalpha(int);
  55. extern int    iscntrl(int);
  56. extern int     isdigit(int);
  57. extern int     isgraph(int);
  58. extern int    islower(int);
  59. extern int    isprint(int);
  60. extern int    ispunct(int);
  61. extern int    isspace(int);
  62. extern int    isupper(int);
  63. extern int    isxdigit(int);
  64.  
  65. #ifndef _LINT
  66. extern char    _ctype[];
  67.  
  68. #define    isalpha(c)    ((_ctype + 1)[c] & (_U | _L))
  69. #define    isupper(c)    ((_ctype + 1)[c] & _U)
  70. #define    islower(c)    ((_ctype + 1)[c] & _L)
  71. #define    isdigit(c)    ((_ctype + 1)[c] & _N)
  72. #define    isxdigit(c)    ((_ctype + 1)[c] & _X)
  73. #define    isalnum(c)    ((_ctype + 1)[c] & (_U | _L | _N))
  74. #define    isspace(c)    ((_ctype + 1)[c] & _S)
  75. #define    ispunct(c)    ((_ctype + 1)[c] & _P)
  76. #define    isprint(c)    ((_ctype + 1)[c] & (_P | _U | _L | _N | _B))
  77. #define    isgraph(c)    ((_ctype + 1)[c] & (_P | _U | _L | _N))
  78. #define    iscntrl(c)    ((_ctype + 1)[c] & _C)
  79. #define    isascii(c)    (!((c) & ~0177))
  80. #define    _toupper(c)     ((_ctype + 258)[c])
  81. #define    _tolower(c)    ((_ctype + 258)[c])
  82. #define    toascii(c)    ((c) & 0177)
  83.  
  84. #endif /* !_LINT */
  85.  
  86. extern int toupper (int);
  87. extern int tolower (int);
  88.  
  89. #ifdef __cplusplus
  90. }
  91. #endif
  92.  
  93. #endif /* !__CTYPE_H__ */
  94.